/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IIndentOperationLog interface for NHibernate mapped table 'IndentOperationLog'.
	/// </summary>
	public interface IIndentOperationLog
	{
		#region Public Properties
		
		int iol_id
		{
			get ;
			set ;
			  
		}
		
		int iol_iblid
		{
			get ;
			set ;
			  
		}
		
		byte iol_oldState
		{
			get ;
			set ;
			  
		}
		
		byte iol_nowState
		{
			get ;
			set ;
			  
		}
		
		DateTime iol_time
		{
			get ;
			set ;
			  
		}
		
		int? iol_user
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// IndentOperationLog object for NHibernate mapped table 'IndentOperationLog'.
	/// </summary>
	[Serializable]
	public class IndentOperationLog : ICloneable,IIndentOperationLog
	{
		#region Member Variables

		protected int _iol_id;
		protected int _iol_iblid;
		protected byte _iol_oldstate;
		protected byte _iol_nowstate;
		protected DateTime _iol_time;
		protected int? _iol_user;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public IndentOperationLog() {}
		
		public IndentOperationLog(int pioliblid, byte piololdState, byte piolnowState, DateTime pioltime, int? pioluser)
		{
			this._iol_iblid = pioliblid; 
			this._iol_oldstate = piololdState; 
			this._iol_nowstate = piolnowState; 
			this._iol_time = pioltime; 
			this._iol_user = pioluser; 
		}
		
		public IndentOperationLog(int pioliblid, byte piololdState, byte piolnowState, DateTime pioltime)
		{
			this._iol_iblid = pioliblid; 
			this._iol_oldstate = piololdState; 
			this._iol_nowstate = piolnowState; 
			this._iol_time = pioltime; 
		}
		
		public IndentOperationLog(int piolid)
		{
			this._iol_id = piolid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int iol_id
		{
			get { return _iol_id; }
			set { _bIsChanged |= (_iol_id != value); _iol_id = value; }
			
		}
		
		public virtual int iol_iblid
		{
			get { return _iol_iblid; }
			set { _bIsChanged |= (_iol_iblid != value); _iol_iblid = value; }
			
		}
		
		public virtual byte iol_oldState
		{
			get { return _iol_oldstate; }
			set { _bIsChanged |= (_iol_oldstate != value); _iol_oldstate = value; }
			
		}
		
		public virtual byte iol_nowState
		{
			get { return _iol_nowstate; }
			set { _bIsChanged |= (_iol_nowstate != value); _iol_nowstate = value; }
			
		}
		
		public virtual DateTime iol_time
		{
			get { return _iol_time; }
			set { _bIsChanged |= (_iol_time != value); _iol_time = value; }
			
		}
		
		public virtual int? iol_user
		{
			get { return _iol_user; }
			set { _bIsChanged |= (_iol_user != value); _iol_user = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			IndentOperationLog castObj = null;
			try
			{
				castObj = (IndentOperationLog)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._iol_id == castObj.iol_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _iol_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for IndentOperationLog 

	
	public interface IIndentOperationLogCollection : ICollection
	{
		IndentOperationLog this[int index]{	get; set; }
		void Add(IndentOperationLog pIndentOperationLog);
		void Clear();
	}
	
	[Serializable]
	public class IndentOperationLogCollection : IIndentOperationLogCollection
	{
		private IList<IndentOperationLog> _arrayInternal;

		public IndentOperationLogCollection()
		{
			_arrayInternal = new List<IndentOperationLog>();
		}
		
		public IndentOperationLogCollection( IList<IndentOperationLog> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<IndentOperationLog>();
			}
		}

		public IndentOperationLog this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((IndentOperationLog[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(IndentOperationLog pIndentOperationLog) { _arrayInternal.Add(pIndentOperationLog); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<IndentOperationLog> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
